(function(){

	var skill = {
		save:function(){
			db.update(config.dbname.evaluation,this._id,this);
		},
		destroy:function(){
			var comment = CommentCon.get(this.comment_id);
			if (!comment) {
				throwCusError("找不到对应的评论");
			}
			comment.destroy();
			db.remove(config.dbname.evaluation,this._id);
		},
		//获取评价详情，包括递归获取子评论
		getDetail:function(){
			var evaluation = $Object.clone(this);
			comment = CommentCon.get(evaluation.comment_id);
			comment = comment.getDetail();
			evaluation.comment = comment;
			evaluation.goods = GoodsCon.get(evaluation.goods_id);
			return evaluation;
		},
	}
	module.exports = skill;

	var db = require("../db/index");
	var UserCon = require("./_con");
	var BusCon = require("../bus/_con");
	var GoodsCon = require("../goods/_con");
	var AchCon = require("../ach/_con");
	var PayAchCon = require("../pay_ach/_con");
	var CommentCon = require("../comment/_con");
	var EvaluationCon = require("../eval/_con")
	var config = require("../_include/config");
	var data_cut = require("../_include/data_cut");
	var $Array = require("../_include/$.Array");
	var $Object = require("../_include/$.Object");

}());
